package com.sn.system.tangs.tag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.AbstractUITag;

import com.opensymphony.xwork2.util.ValueStack;

public class DialogTag extends AbstractUITag{

	private String id;
	private String title;
	private String msg;
	private String confirm;
	private String okFunction;
	private String cancelFunction;
	private String openFunction;
	private String focusOn;
	private String disabled;
	private String readonly;
	private String openButtonname;
	private String autoOpen;
	private String cssClass;
	private String cssStyle;

	/**
     * パラメータを取りする
     */
    protected void populateParams() {
        super.populateParams();

        Dialog dialog = (Dialog)component;
        dialog.setId(id);
        dialog.setTitle(title);
        dialog.setMsg(msg);
        dialog.setConfirm(confirm);
        dialog.setOkFunction(okFunction);
        dialog.setCancelFunction(cancelFunction);
        dialog.setFocusOn(focusOn);
        dialog.setDisabled(disabled);
        dialog.setReadonly(readonly);
        dialog.setOpenButtonname(openButtonname);
        dialog.setAutoOpen(autoOpen);
        dialog.setCssClass(cssClass);
        dialog.setCssStyle(cssStyle);
        dialog.setOpenFunction(openFunction);
    }

	public Component getBean(ValueStack stack, HttpServletRequest request,
			HttpServletResponse response) {
		return new Dialog(stack, request, response);
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public void setConfirm(String confirm) {
		this.confirm = confirm;
	}

	public void setOkFunction(String okFunction) {
		this.okFunction = okFunction;
	}

	public void setCancelFunction(String cancelFunction) {
		this.cancelFunction = cancelFunction;
	}

	public void setFocusOn(String focusOn) {
		this.focusOn = focusOn;
	}

	public void setDisabled(String disabled) {
		this.disabled = disabled;
	}

	public void setReadonly(String readonly) {
		this.readonly = readonly;
	}

	public void setOpenButtonname(String openButtonname) {
		this.openButtonname = openButtonname;
	}

	public void setAutoOpen(String autoOpen) {
		this.autoOpen = autoOpen;
	}

	public void setCssClass(String cssClass) {
		this.cssClass = cssClass;
	}

	public void setCssStyle(String cssStyle) {
		this.cssStyle = cssStyle;
	}

	public void setOpenFunction(String openFunction) {
		this.openFunction = openFunction;
	}


}
